<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>-->
<!--<%-->
<!--String path = request.getContextPath();-->
<!--String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";-->
<!--%>-->

<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<!--    <base href="<%=basePath%>">-->

    <title>My JSP 'customer.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <link th:insert="~{views/script :: tiancai}"/>
</head>
<!--  <%@include file="../../script.html" %>-->
<body>
<div id="tt" class="easyui-tabs" style="width:1500px">
    <div title="商机" style="padding:20px;display:none;" data-options="iconCls:'icon-man',plain:true">
<!--        <iframe th:src="@{/system/business/BusinessAction_list.action}" width="100%" height="100%" frameBorder="0"></iframe>-->
        <form id="form" method="post">
            <strong>主要信息</strong>
            <section class="info-section">

                <table id="tb">
                    <tr>
                        <td class="text-title">负责人</td>
                        <td class="text-content">
                            <input type="hidden" name="id">
                            <!--                    <input type="hidden" name="busiVO.createById" th:value="${ }">-->
                            <select class="myselect" name="ownerUserId">
                                <option
                                        th:each="u:${list}"
                                        th:value="${u.getId()}"
                                >[[${u.getUserName()}]]</option>
                            </select>
                        </td>
                        <td class="text-title">客户</td>
                        <td class="text-content">
                            <select class="myselect" name="customerId">
                                <option
                                        th:each="cu:${cus}"
                                        th:value="${cu.getId()}"
                                >[[ ${cu.getCustomerName()} ]]</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-title">商机金额</td>
                        <td class="text-content">
                            <input type="text" name="salesPrice"
                                   class="easyui-textbox theme-textbox-radius" data-options="required:false">
                        </td>
                        <td class="text-title">商机名</td>
                        <td class="text-content">
                            <input type="text" name="bname"
                                   class="easyui-textbox theme-textbox-radius" data-options="required:false">
                        </td>
                    </tr>
                    <tr>
                        <td class="text-title">联系人</td>
                        <td class="text-content">
                            <select class="myselect" name="contactsId">
                                <option
                                        th:each="co:${con}"
                                        th:value="${co.getId()}"
                                >[[${co.getConname()}]]</option>
                            </select>
                        </td>

                    </tr>
                    <tr>
                        <td class="text-title">合同签订地址</td>
                        <td class="text-content" colspan="3">
                            <input type="text" style="width:550px;" name="contractAddress"
                                   class="easyui-textbox theme-textbox-radius" data-options="required:false">
                        </td>
                    </tr>
                    <tr>
                        <td class="text-title">商机类型</td>
                        <td class="text-content">
                            <select class="myselect" name="type">
                                <option
                                        th:each="s:${bus}"
                                        th:value="${s.getType()}"
                                >[[${s.getType()}]]</option>
                            </select>
                        </td>
                        <td class="text-title">状态</td>
                        <td class="text-content">
                            <select class="myselect" name="businessStatusId">
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-title">商机来源</td>
                        <td class="text-content">
                            <select class="myselect" name="origin">
                                <option
                                        th:each="s:${buss}"
                                        th:value="${s.getOrigin()}"
                                >[[${s.getOrigin()}]]</option>
                            </select>
                        </td>
                        <td class="text-title">赢单率</td>
                        <td class="text-content">
                            <input type="text" name="gainrate"
                                   class="easyui-textbox theme-textbox-radius" data-options="required:false">
                        </td>
                    </tr>
                    <tr>
                        <td class="text-title">预定成交价</td>
                        <td class="text-content">
                            <input type="text" name="estimatePrice"
                                   class="easyui-textbox theme-textbox-radius" data-options="required:true">
                        </td>
                        <td class="text-title">下次联系时间</td>
                        <td class="text-content">
                            <input class="easyui-datetimebox" name="nextstepTime"
                                   data-options="required:false,showSeconds:false" style="width:150px">
                        </td>
                    </tr>
                    <tr>
                        <td class="text-title">下次联系内容</td>
                        <td class="text-content">
                            <input type="text" name="nextstep"
                                   class="easyui-textbox theme-textbox-radius" data-options="required:false">
                        </td>
                    </tr>
                </table>
            </section>
            <strong>附加信息</strong>
            <section class="info-section">
                <table>
                    <tr>
                        <td class="text-title">备注</td>
                        <td class="text-content">
                            <textarea name="description" rows="5" style="width:80%;"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="text-align: center;margin-top: 10px;">
                            <a href="javascript:void(0);" id="saveBtn" class="easyui-linkbutton button-primary"
                               style="margin-left:-70px;">保存</a>
                            <a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger"
                               style="margin-left:30px;">重置</a>
                        </td>
                    </tr>
                </table>
            </section>
        </form>

        <script type="text/javascript" th:inline="none">

            $(function () {
                //重置按钮
                $("#resetBtn").on("click", function (event) {
                    $("#form").form("reset");
                });
                //保存按钮
                $("#saveBtn").on("click", function (event) {
                    $("#form").form("submit", {
                        url: "/manage/business/BusinessAction_SaveBusiness.action",
                        onSubmit: function () {
                            //对表单进行数据校验,如果未通过校验，返回false，阻止表单提交
                            return $(this).form("validate");

                        },
                        success: function (data) {
                            //data未服务器端返回的字符串数据，eval将字符串数据转换为json对象
                            data = eval("(" + data + ")");
                            if (data.success) {
                                parent.closeTopWindow();
                            }
                        }
                    });
                });
            });
        </script>
    </div>
    <div title="统计" data-options="iconCls:'icon-man',plain:true" style="overflow:auto;padding:20px;display:none;">

    </div>
    <div title="帮助" data-options="iconCls:'icon-help',plain:true" style="padding:20px;display:none;">

    </div>
</div>
</body>
</html>
